export const watchnameVf = [
  {
    required: true,
    message: "请输入平台名称",
    trigger: "change"
  },
  { min: 3, max: 10, message: "平台名称在3到10个字符", trigger: "change" }
];
export const logoVf = [
  {
    required: true,
    message: "请上传logo",
    trigger: "change"
  }
];
export const classifynameVf = [
  {
    required: true,
    message: "请输入分类名称",
    trigger: "change"
  },
  { min: 2, max: 20, message: "分类名称在2到20个字符", trigger: "change" }
];

export const classifyparentidVf = [
  {
    required: true,
    message: "请选择上级分类",
    trigger: "change"
  }
];
export const classifylayerVf = [
  {
    required: true,
    message: "请选择分类级别",
    trigger: "change"
  }
];

export const teamnameVf = [
  {
    required: true,
    message: "请输入分类名称",
    trigger: "change"
  },
  { min: 2, max: 20, message: "分类名称在2到20个字符", trigger: "change" }
];
export const classifyVf = [
  {
    required: true,
    message: "请选择分类",
    trigger: "change"
  }
];
export const scheduleStarttimeVf = [
  {
    required: true,
    message: "请选择赛程时间",
    trigger: "change"
  }
];
export const starttimehourVf = [
  {
    required: true,
    message: "请选择比赛时间",
    trigger: "change"
  }
];
export const watchidVf = [
  {
    required: true,
    message: "请选择观看平台",
    trigger: "change"
  }
];
export const teamaidVf = [
  {
    required: true,
    message: "请选择队伍一",
    trigger: "change"
  }
];
export const teambidVf = [
  {
    required: true,
    message: "请选择队伍二",
    trigger: "change"
  }
];
export const teamascoreVf = [
  {
    required: true,
    message: "请选择队伍一比分",
    trigger: "change"
  }
];
export const teambscoreVf = [
  {
    required: true,
    message: "请选择队伍二比分",
    trigger: "change"
  }
];
export const sysconfignameVf = [
  {
    required: true,
    message: "请输入参数名称",
    trigger: "change"
  },
  { min: 2, max: 10, message: "参数名称在2到10个字符", trigger: "change" }
];
export const sysconfigvalueVf = [
  {
    required: true,
    message: "请输入参数值",
    trigger: "change"
  }
];
export const rolecodeVf = [
  {
    required: true,
    message: "请输入角色代码",
    trigger: "change"
  },
  { min: 2, max: 10, message: "角色代码在2到10个字符", trigger: "change" }
];
export const rolenameVf = [
  {
    required: true,
    message: "请输入角色名称",
    trigger: "change"
  },
  { min: 2, max: 10, message: "角色名称在2到10个字符", trigger: "change" }
];
export const usernameVf = [
  {
    required: true,
    message: "请输入用户名",
    trigger: "change"
  },
  { min: 3, max: 10, message: "用户名在3到10个字符", trigger: "change" }
];
export const userpasswdVf = [
  {
    required: true,
    message: "请输入密码",
    trigger: "change"
  },
  { min: 6, max: 16, message: "密码在6到16个字符", trigger: "change" }
];
export const userphoneVf = [
  { required: true, message: "请输入手机号码", trigger: "blur" },
  { min: 11, max: 11, message: "请输入11位手机号码", trigger: "blur" },
  {
    pattern:
      /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/,
    message: "请输入正确的手机号码"
  }
];
// export const userphoneVf = [
//   { required: true, message: "请输入手机号", trigger: "blur" },
//   {
//     pattern: /^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/,
//     message: "请输入正确的手机号码或者座机号"
//   }
// ];
// export const useremailVf = [
//   { required: true, message: "请输入邮箱地址", trigger: "blur" },
//   {
//     type: "email",
//     message: "请输入正确的邮箱地址",
//     trigger: ["blur", "change"]
//   }
// ];
// export const useremailVf = [
//   { required: true, message: "请输入你的邮箱", trigger: "blur" },
//   {
//     validator: checkEmail,
//     min: 9,
//     max: 18,
//     message: "邮箱格式错误",
//     trigger: "blur"
//   }
// ];

export function useremailVf() {
  const checkEmail = (rule, value, cb) => {
    //验证邮箱的正则表达式
    const regEmail = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
    if (regEmail.test(value)) {
      //合法的邮箱
      return cb();
    }
    cb(new Error("请输入合法的邮箱"));
  };
  return [
    { required: true, message: "请输入你的邮箱", trigger: "blur" },
    {
      validator: checkEmail,
      min: 9,
      max: 18,
      message: "邮箱格式错误",
      trigger: "blur"
    }
  ];
}
export const userroleVf = [
  {
    required: true,
    message: "请选择角色",
    trigger: "change"
  }
];

export const carouseltitleVf = [
  {
    required: true,
    message: "请输入标题",
    trigger: "change"
  },
  { min: 3, max: 50, message: "标题在3到50个字符", trigger: "change" }
];
export const carouselphotoVf = [
  {
    required: true,
    message: "请上传图片",
    trigger: "change"
  }
];
export const carousellinkVf = [
  {
    required: true,
    message: "请输入参数值",
    trigger: "change"
  }
];
export const contentstitleVf = [
  {
    required: true,
    message: "请输入标题",
    trigger: "change"
  },
  { min: 3, max: 50, message: "标题在3到50个字符", trigger: "change" }
];
export const contentscontentVf = [
  {
    required: true,
    message: "请输入参数值",
    trigger: "change"
  }
];
export const contentsphotoVf = [
  {
    required: true,
    message: "请上传图片",
    trigger: "change"
  }
];
